<template>
  <div>
    <el-button @click="handleClick">点我弹出用户组件弹框</el-button>
    <el-button @click="handleClick2">点我弹出用户组件弹框</el-button>
  </div>
</template>

<script>
import {useDialog} from "@/components/dialog4/MyDialog";
import UserForm from "@/components/dialog4/UserForm";
import StudentForm from "@/components/dialog4/StudentForm";

export default {
  name: "MyDialogTest",
  methods: {
    handleClick() {
      const close = useDialog(UserForm, {title: "新增用户表单", message: "是否确定?", icon: "warn"}, (params) => {
        console.log("Test.....", params);
        close();
      }, () => {
        console.log("取消按钮被点击");
        close();
      })
    },
    handleClick2() {
      const close = useDialog(StudentForm, {title: '新增学生', message: '', icon: ""}, (params) => {
        console.log(">>>>>>>>>>>>>>> Test = ", params);
        close();
      }, () => {

      })
    }
  }
}
</script>

<style scoped>

</style>